package com.woniuxy.educationplatform.service.impl;

import com.woniuxy.educationplatform.bean.VideoBean;
import com.woniuxy.educationplatform.mapper.VideoMapper;
import com.woniuxy.educationplatform.service.IVideoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(readOnly = true)
public class VideoServiceImpl implements IVideoService {
    @Resource
    private VideoMapper videoMapperImpl;

    @Override
    public List<VideoBean> findAll() {
        return videoMapperImpl.findAll();
    }

    @Override
    public VideoBean findById(Long id) {
        return videoMapperImpl.findById(id);
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public void saveVideoBean(VideoBean videoBean) {

    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public void deleteVideoBean(Long id) {

    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public void update(VideoBean videoBean) {

    }


    @Override
    public List<VideoBean> findOneByCondition(VideoBean videoBean) {
        return videoMapperImpl.findOneByCondition(videoBean);
    }
}
